#include<iostream>
using namespace std;

int main() {
	int n = 0;
	cin >> n;
	int ans = 0;
	for (int i = 0;i < n;i++) {
		int x = 0;
		cin >> x;
		if (x != 1) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}